package com.example.demo.dao;

import com.example.demo.pojo.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ArticleRepository extends JpaRepository<Article, Integer> {
    List<Article> findByTitleContaining(String title);
    @Query("select o from Article o where o.title like %?1% and o.body like %?2%")
    List<Article> query(String title, String body);
}
